import { createRouter, createWebHistory } from 'vue-router'
import LoginPage from '../views/login/LoginPage.vue'
import WelcomePage from '@/views/admin/WelcomePage.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // {
    //   path: '/',
    //   name: 'home',
    //   component: HomeView,
    //   redirect: '/welcome',
    //   children: [
    //     {
    //       path: '/welcome',
    //       name: 'welcome',
    //       component: () => import('../views/home/WelcomeView.vue'),
    //     },
    //     {
    //       path: '/about',
    //       name: 'about',
    //       component: () => import('../views/home/about/AboutViewA.vue'),
    //     },
    //     {
    //       path: '/login',
    //       name: 'login',
    //       component: () => import('../views/login/LoginView.vue'),
    //     },
    //     {
    //       path: '/register',
    //       name: 'register',
    //       component: () => import('../views/home/RegisterView.vue'),
    //     },
    //   ],
    // },

        // 登录页面
    {
      path: '/',
      name: 'LoginPage',
      component: LoginPage,
    },

    // 后台管理页
    {
      path: '/WelcomePage',
      name: 'WelcomePage',
      redirect: 'AdminIndexPage',
      component: WelcomePage,
      children:[
        {
          path: '/AdminIndexPage',
          name: 'AdminIndexPage',
          component: () => import('../views/admin/IndexPage.vue'),
        },
        {
          path: '/ItemPage_1',
          name: 'ItemPage_1',
          children: [
            {
              path: '/ItemPage_1/DataPage',
              name: '/ItemPage_1/DataPage',
              component: () => import('../views/admin/item_1/function/data/DataPage.vue'),
            },
            {
              path: '/ItemPage_1/EngineeringPage',
              name: '/ItemPage_1/EngineeringPage',
              component: () => import('../views/admin/item_1/function/engineeringProject/EngineeringPage.vue'),
            }
          ]
        },
        {
          path: '/ItemPage_2',
          name: 'ItemPage_2',
          children: [
            {
              path: '/ItemPage_2/DataPage',
              name: '/ItemPage_2/DataPage',
              component: () => import('../views/admin/item_2/function/data/DataPage.vue'),
            },
            {
              path: '/ItemPage_2/EngineeringPage',
              name: '/ItemPage_2/EngineeringPage',
              component: () => import('../views/admin/item_2/function/engineeringProject/EngineeringPage.vue'),
            }
          ]
        },
        {
          path: '/ItemPage_3',
          name: 'ItemPage_3',
          children: [
            {
              path: '/ItemPage_3/DataPage',
              name: '/ItemPage_3/DataPage',
              component: () => import('../views/admin/item_3/function/data/DataPage.vue'),
            },
            {
              path: '/ItemPage_3/EngineeringPage',
              name: '/ItemPage_3/EngineeringPage',
              component: () => import('../views/admin/item_3/function/engineeringProject/EngineeringPage.vue'),
            }
          ]
        },
        {
          path: '/ItemPage_4',
          name: 'ItemPage_4',
          children: [
            {
              path: '/ItemPage_4/DataPage',
              name: '/ItemPage_4/DataPage',
              component: () => import('../views/admin/item_4/function/data/DataPage.vue'),
            },
            {
              path: '/ItemPage_4/EngineeringPage',
              name: '/ItemPage_4/EngineeringPage',
              component: () => import('../views/admin/item_4/function/engineeringProject/EngineeringPage.vue'),
            }
          ]
        },
        {
          path: '/ItemPage_5',
          name: 'ItemPage_5',
          children: [
            {
              path: '/ItemPage_5/DataPage',
              name: '/ItemPage_5/DataPage',
              component: () => import('../views/admin/item_5/function/data/DataPage.vue'),
            },
            {
              path: '/ItemPage_5/EngineeringPage',
              name: '/ItemPage_5/EngineeringPage',
              component: () => import('../views/admin/item_5/function/engineeringProject/EngineeringPage.vue'),
            }
          ]
        },
        {
          path: '/UserAccount',
          name: 'UserAccount',
          children: [
            {
              path: '/UserAccount/DataPage',
              name: '/UserAccount/DataPage',
              component: () => import('../views/admin/userAccount/function/data/DataPage.vue'),
            },
            {
              path: '/UserAccount/EngineeringPage',
              name: '/UserAccount/EngineeringPage',
              component: () => import('../views/admin/userAccount/function/engineeringProject/EngineeringPage.vue'),
            }
          ]
        },
        {
          path: '/Setting',
          name: 'Setting',
          children: [
            {
              path: '/Setting/DataPage',
              name: '/Setting/DataPage',
              component: () => import('../views/admin/setting/function/data/DataPage.vue'),
            },
            {
              path: '/Setting/EngineeringPage',
              name: '/Setting/EngineeringPage',
              component: () => import('../views/admin/setting/function/engineeringProject/EngineeringPage.vue'),
            }
          ]
        },
      ]
    },
    {
      path: '/visualization',
      name: 'visualization',
      component: () => import('../views/visualizations/Index.vue'),
    },
  ],
})

export default router
